#ifndef _LT_GAME_H_
#define _LT_GAME_H_

#include "ltSingleton.h"
#include "ltLog.h"
#include "fastsig/fastsig.hpp"

namespace Lotus
{
	class IGameState;

	class LOTUS_API Game: Utilities::Singleton<Game>
	{
	public:
		Game();
		virtual ~Game();
		LT_DECLARE_SINGLETON(Game);

		virtual bool init();
		void run();
		Utilities::Log& log() const;
		void setPaused(bool pause);
		bool isPaused() const;
		void shutdown();

		virtual IGameState* getInitialState() const = 0;
		void changeState(IGameState* newState);
		void changeMap(const char* newMap);
		IGameState* getCurrentState() const;

		fastsig::signal<void()> ActivateEditorSignal;	

	protected:
		virtual bool initGraphicManager();
		virtual bool initInputManager();
		virtual bool initMapFactory();
		virtual bool initGUI();

	private:
		void update(const Ogre::FrameEvent& ev);

		fastsig::connection frameEvent;
		Utilities::Log* Log;
		IGameState* currentState;
		bool pause;
	};
}

#endif